package ic.doc.co2nudge.shared.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Embedded;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

import org.apache.commons.lang.builder.HashCodeBuilder;

import com.google.web.bindery.requestfactory.server.*;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Entity;

@Entity
public class Trip implements Serializable {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	
	private String name;
	
	private Date date;
	
	private String from;
	
	private String to;
	
	private Double distance;
	
	private Integer numOfPeople;
	
	@Embedded
	private TripOption maxCO2option;
	
	@Embedded
	private TripOption minCO2option;
	
	@Embedded
	private TripOption chosenCO2option;
	
	private Key<User> user;
	
	public Long getId(){
		return this.id;
	}
	
	public String getName(){
		return this.name;
	}
	
	public void setName(String name){
		this.name=name;
	}
	
	public Date getDate(){
		return this.date;
	}
	
	public void setDate(Date date){
		this.date=date;
	}
	
	public Double getDistance(){
		return this.distance;
	}
	
	public void setDistance(Double distance){
		this.distance=distance;
	}
	
	public String getFrom(){
		return this.from;
	}
	
	public void setFrom(String from){
		this.from=from;
	}
	
	public String getTo(){
		return this.to;
	}
	
	public void setTo(String to){
		this.to=to;
	}

	public Integer getNumOfPeople(){
		return this.numOfPeople;
	}
	
	public void setNumOfPeople(Integer num){
		this.numOfPeople=num;
	}

	public TripOption getMaxCO2Option(){
		return this.maxCO2option;
	}
	
	public void setMaxCO2Option(TripOption option){
		this.maxCO2option=option;
	}
	
	public TripOption getMinCO2Option(){
		return this.minCO2option;
	}
	
	public void setMinCO2Option(TripOption option){
		this.minCO2option=option;
	}
	
	public TripOption getChosenCO2Option(){
		return this.chosenCO2option;
	}
	
	public void setChosenCO2Option(TripOption option){
		this.chosenCO2option=option;
	}
	
	public Key<User> getUserKey(){
		return this.user;
	}
	
	public void setUserKey(Key<User> user){
		this.user=user;
	}
	
//	public Key<TripOption> getMaxCO2Option(){
//		return this.maxCO2option;
//	}
	
//	public void setMaxCO2Option(Key<TripOption> option){
//		this.maxCO2option=option;
//	}
	
//	public User getUser(){
//		return this.user;
//	}
//	
//	public void setUser(User user){
//		this.user=user;
//	}
}
